CSV2FXT SCRIPT

To achieve 99.0% modeling quality in MetaTrader 4 (MT4) backtesting, you can use Birt’s CSV2FXT script to convert raw tick data into MT4-compatible FXT and HST files. This method gives you full control over spreads, execution, and data accuracy.

Prerequisites

  1. MetaTrader 4: Installed and launched at least once.
  2. Birt’s CSV2FXT Script: Download link provided at the bottom of this page.
  3. Tick Data (CSV format): From Dukascopy, TrueFX, or Tickstory Lite.
  4. Tickstory Lite (optional): Used only to download and export CSV tick data.

Important Note

Tickstory Lite is not used to generate FXT files in this workflow. It is optional and serves only as a convenient source of high-quality CSV tick data. The FXT files are generated exclusively by the CSV2FXT script.

Step-by-Step Guide (CSV2FXT Method)

Step 1: Install CSV2FXT into MT4

  1. Open your MT4 data folder (File → Open Data Folder).
  2. Copy the contents of the mql4 folder from the CSV2FXT package.
  3. Paste the Include, Libraries, and Scripts folders into the MT4 MQL4 directory.
  4. Restart MT4.

Step 2: Obtain Tick Data (CSV)

  1. Download tick data from Dukascopy, TrueFX, or Tickstory Lite.
  2. If using Tickstory Lite:
    • Select the symbol and date range.
    • Export the data as CSV (not MT4).
  3. Ensure the CSV contains date, time, bid, and ask prices.

Step 3: Prepare the CSV File

  1. Place the CSV file in the MT4 directory: MQL4/Files
  2. Verify the filename matches what you will select in the script inputs.

Step 4: Run the CSV2FXT Script

  1. Open MT4.
  2. Open any chart for the correct symbol.
  3. In the Navigator panel, go to Scripts and drag CSV2FXT onto the chart.
  4. Configure the inputs:
    • CSV filename
    • Timeframe
    • Fixed or variable spread
    • Commission and execution options
  5. Click OK and wait for the script to finish.
CSV2FXT settings FXT generation process MT4 files created

Step 5: Backtesting in MT4

  1. Open View → Strategy Tester.
  2. Select your Expert Advisor.
  3. Select the correct symbol and timeframe.
  4. Set model to Every Tick.
  5. Choose the date range covered by your data.
  6. Click Start.

Step 6: Verify Results

  1. Check the report for 99.0% modeling quality.
  2. Confirm no data mismatch or gaps are reported.

Tips

  • Always regenerate FXT files if you change spread or timeframe.
  • Use realistic spreads and commissions for reliable results.